package org.example.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ForwardVsRedirect {


    //这种是写全的
    @RequestMapping("/forward")
    public String forward(){
        //这种是转发的省略写法
//        return "/test.html";
        return "forward:/test.html";
    }

    //重定向
    @RequestMapping("/redirect")
    public String redirect(){
        return "redirect:/test.html";
    }
}
